package ch02;

/**
 * @author chenmin
 * @desc TODO
 * @date 2025/9/2
 */
import java.util.Scanner;
public class For4 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.print("请输入一个整数：");
        int num = in.nextInt();
        int reversedNum = 0;
        for (; num != 0; num /= 10) {
            int digit = num % 10;
            reversedNum = reversedNum * 10 + digit;
        }
        System.out.println("倒排后的整数是：" + reversedNum);
        in.close();
    }
}
